{% extends 'base.html' %}
{% load static %}
{% block title %}添加模块/参数{% endblock %}
{% block content %}
    <div>
        <form action="" method="post" class="form-inline">
            {% csrf_token %}
            <div class="form-group">
                <label>模块：</label>
                <input type="text" class="form-control" name="module">
            </div>
            <div class="form-group">
                <label>参数：</label>
                <input type="text" class="form-control" name="arg">
            </div>
            <div class="form-group">
                <input type="submit" class="btn btn-primary" value="提 交">
            </div>
        </form>
    </div>
    <hr>
    <div>
        <table class="table table-bordered table-hover">
            <tr class="info">
                <td>模块</td>
                <td>参数</td>
            </tr>
            {% for module in modules %}
                <tr>
                    <td>{{ module.module_name }}</td>
                    <td>
                        <ul class="list-unstyled">
                            {% for argument in module.argument_set.all %}
                                <li>
                                    <div class="col-md-9">{{ argument.argument_text }}</div>
                                    <div class="col-md-3"><a href="{% url 'delarg' arg_id=argument.id %}">删除</a></div>
                                </li>
                            {% endfor %}
                        </ul>
                    </td>
                </tr>
            {% endfor %}
        </table>
    </div>
{% endblock %}